package com.anping.service.impl;

import com.anping.dao.UserMapper;
import com.anping.model.User;
import com.anping.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by admin on 2016/7/18.
 */
@Service("userService")
public class UserServiceImpl implements UserService{

    @Resource
    private UserMapper userMapper;

    public boolean addUser(User user) {
        int flag = userMapper.insert(user);
        return flag>0?true:false;
    }

    public User findUserById(int userId) {
        User user = userMapper.selectByPrimaryKey(userId);
        return user;
    }

    public List<User> findUserByName(String userName) {
        return null;
    }

    public List<User> findUserList(User user) {
        return userMapper.selectUserList(user);
    }

    public boolean deleteUserById(String userId) {
        return false;
    }

    public boolean batchDeleteUser(List<String> userIds) {
        return false;
    }

    public boolean updateUser(User user) {
        return false;
    }
}
